import { IConfigFromPlugins } from '@@/core/pluginConfig';
import type { IConfig } from '@umijs/preset-umi';

declare type ConfigType = IConfigFromPlugins & IConfig;

const routes: ConfigType['routes'] = [
  // { path: '/', component: '@/pages/index' },
  { path: '/user/login', component: '@/pages/user/login/index', layout: false },
  {
    path: '/',
    // component: '@/pages/index',
    wrappers: [ '@/wrappers/auth' ],
    routes: [
      {
        path: 'sys',
        // component: '@/pages/sys/user/index',
        routes: [
          { path: 'user', component: '@/pages/sys/user/index' },
          { path: 'tenant', component: '@/pages/sys/tenant/index' },
          { path: 'dept', component: '@/pages/sys/dept/index' },
          { path: 'role', component: '@/pages/sys/role/index' },
          { path: 'menu', component: '@/pages/sys/menu/index' },
          { path: 'permission', component: '@/pages/sys/permission/index' },
          { path: 'token', component: '@/pages/sys/token/index' },
          { path: 'log', component: '@/pages/sys/log/index' },
        ],
      },
      {
        path: 'dev',
        // component: '@/pages/dev/index',
        routes: [
          { path: 'database', component: '@/pages/dev/database/index' },
          { path: 'table', component: '@/pages/dev/table/index' },
          { path: 'generator', component: '@/pages/dev/generator/index' },
          {
            path: 'meta',
            // component: '@/pages/dev/index',
            routes: [
              { path: 'field', component: '@/pages/dev/meta/field/index' },
              { path: 'template', component: '@/pages/dev/meta/template/index' },
              { path: 'templateGroup', component: '@/pages/dev/meta/template_group/index' },
            ],
          },
        ],
      },
    ],
  },

];

export default routes;